public class FindMax {

	public static void main(String[] args) {

		Integer a = 2;
		Integer b = 3;
		Integer c = 2;
		Integer d = 1;

		Integer result = null;

		// pierwszy sposob
		if (a >= b && a >= c && a >= d)
			result = a;

		if (b > a && b >= c && b >= d)

			result = b;

		if (c >= a && c > b && c >= d)
			result = c;

		if (result == null) // jak poprzednie nie beda spelnione to ten moze byc
							// zamias(d >= a && d >= b && d > c)
			result = d;

		System.out.println("result1:" + result);

		// drugi sposob
		result = null;
		
		if (a >= b)
			result = a;

		if (a < b)
			result = b;

		if (result < c)
			result = c;

		if (result < d)
			result = d;

		System.out.println("result2:" + result);

	}
}
